package com.smartleanx.module.hrm.service.payroll;

import com.smartleanx.framework.common.pojo.PageResult;
import com.smartleanx.module.hrm.controller.admin.payroll.vo.PayrollImportRespVO;
import com.smartleanx.module.hrm.controller.admin.payroll.vo.PayrollPageReqVO;
import com.smartleanx.module.hrm.dal.dataobject.payroll.PayrollDO;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Positive;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 薪资月份 Service 接口
 *
 * @author zhangchp
 */
public interface PayrollService {

    /**
     * 归档
     * @param id ID
     */
    void archive(Long id);

    /**
     * 校验
     * @param id
     */
    void validateNotArchive(Long id);

    /**
     * 获得薪资月份
     *
     * @param id ID
     * @return 薪资月份
     */
    PayrollDO getPayroll(Long id);

    /**
     * 获得薪资月份
     *
     * @param states 薪资状态
     * @return 薪资月份
     */
    PayrollDO getPayrollByState(Collection<Integer> states);

    /**
     * 获得薪资月份分页
     *
     * @param pageReqVO 分页查询
     * @return 薪资月份分页
     */
    PageResult<PayrollDO> getPayrollPage(PayrollPageReqVO pageReqVO);

    /**
     * 导入薪资
     * @param dataList 数据
     * @param year
     * @param month
     * @return 导入结果
     */
    PayrollImportRespVO importPayrollList(List<Map<String, String>> dataList, @Positive(message = "年份格式非法") Integer year,
                                                @Range(min = 1, max = 12, message = "月份格式非法") Integer month);

    void deletePayroll(Long id);
}